//
//  sHkPtEJLCFMineRequestozAYZs.m
//  qcb_ios
//
//  Created by Ji on 2018/8/28.
//  Copyright © 2018年 ski. All rights reserved.
//

#import "sHkPtEJLCFMineRequestozAYZs.h"
#import "adzzGeJLCFMineResultModelgalpta.h"
#import "UstyRGJLCFMineAboutResultModelaqnoMC.h"
#import "JLCFBaseDicModel.h"
#import "cygGGEJLCFMineSettingResultModelqnTwtB.h"



#define MINE_HOME_URL                                                       QTZ_REQUEST_URL(@"user/homeindex/auth")
#define MINE_ABOUT_URL                                                      QTZ_REQUEST_URL(@"user/about")
#define MINE_VERPHONE_URL                                                   QTZ_REQUEST_URL(@"user/verphone")
#define LOGIN_URL                                                           QTZ_REQUEST_URL(@"user/load")
#define MSGCODE_URL                                                         QTZ_REQUEST_URL(@"user/sendcode")
#define REGISTER_URL                                                        QTZ_REQUEST_URL(@"user/signup")
#define FORGETPASS_URL                                                      QTZ_REQUEST_URL(@"user/modifyPass")
#define INVESTRECORD_URL                                                    QTZ_REQUEST_URL(@"borrow/inverstRecords/auth")
#define MONEYLOG_URL                                                        QTZ_REQUEST_URL(@"user/moneylog/auth")
#define SETTING_URL                                                         QTZ_REQUEST_URL(@"user/set/auth")
#define CHANGEPASS_URL                                                      QTZ_REQUEST_URL(@"user/updatePass/auth")
#define BANKCARD_URL                                                        QTZ_REQUEST_URL(@"user/myBankCard/auth")
#define BINDCARDMSG_URL                                                     QTZ_REQUEST_URL(@"borrow/agree/flFGIcbindCardmirovYSendMsg/auth")
#define UNBINDCARDMSG_URL                                                   QTZ_REQUEST_URL(@"user/sendUnflFGIcbindCardmirovYCode/auth")
#define BINDCARD_URL                                                        QTZ_REQUEST_URL(@"borrow/agree/flFGIcbindCardmirovY/auth")
#define MINE_ADDRESS_LIST_URL                                               QTZ_REQUEST_URL(@"activity/userAddress/auth")
#define SAVEANDUPDATE_ADDRESS_URL                                            QTZ_REQUEST_URL(@"activity/saveAndUpdateAddress/auth")
#define WELFARE_URL                                                         QTZ_REQUEST_URL(@"activity/hongbao/auth")
#define DELETEADDRESS_URL                                                   QTZ_REQUEST_URL(@"activity/delAddress/auth")
#define TOPUP_URL                                                           QTZ_REQUEST_URL(@"borrow/account/h5Recharge/auth")
#define WITHDRAW_URL                                                        QTZ_REQUEST_URL(@"borrow/account/withdraw/auth")
#define CODEBANK_URL                                                        QTZ_REQUEST_URL(@"user/sendBankCode/auth")
#define BANK_SURPORT                                                        QTZ_REQUEST_URL(@"borrow/QueryCardBinResult")
#define HAS_CART                                                            QTZ_REQUEST_URL(@"user/set/auth")
#define MY_CARD                                                            QTZ_REQUEST_URL(@"user/myBankCard/auth")
@implementation sHkPtEJLCFMineRequestozAYZs

+ (void)postMineDataWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(PBseiKJLCFMineDataModelWqnMcO *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MINE_HOME_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        adzzGeJLCFMineResultModelgalpta *mine = [[adzzGeJLCFMineResultModelgalpta alloc] initWithDictionary:result error:nil];
        if ([mine.code isEqualToString:@"200"]) {
            if (success) {
                success(mine.data);
            }
        }else {
            if (failure) {
                failure(mine.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
    
}

+ (void)postAboutDataWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(KTdPjIJLCFMineAboutDataModelQJYFdE *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MINE_ABOUT_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        UstyRGJLCFMineAboutResultModelaqnoMC *about = [[UstyRGJLCFMineAboutResultModelaqnoMC alloc] initWithDictionary:result error:nil];
        if ([about.code isEqualToString:@"200"]) {
            if (success) {
                success(about.data);
            }
        }else {
            if (failure) {
                failure(about.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)verPhoneWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(NSString *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MINE_VERPHONE_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success([dic.data objectForKey:@"status"]);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)loginWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:LOGIN_URL params:params loadingInView:view success:^(NSDictionary *result) {

        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];

        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }

    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)postMsgCodeWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MSGCODE_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)registerWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:REGISTER_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)forgetPassWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:FORGETPASS_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)investRecordWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(BRicKPJLCFMineInverstRecordResultModelHOdSFM *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:INVESTRECORD_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        BRicKPJLCFMineInverstRecordResultModelHOdSFM *invest = [[BRicKPJLCFMineInverstRecordResultModelHOdSFM alloc] initWithDictionary:result error:nil];
        
        if ([invest.code isEqualToString:@"200"]) {
            if (success) {
                success(invest);
            }
        } else {
            if (failure) {
                failure(invest.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)moneyLogWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(hphaptJLCFMineMoneyLogResultModeldhpqVh *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MONEYLOG_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        hphaptJLCFMineMoneyLogResultModeldhpqVh *money = [[hphaptJLCFMineMoneyLogResultModeldhpqVh alloc] initWithDictionary:result error:nil];
        
        if ([money.code isEqualToString:@"200"]) {
            if (success) {
                success(money);
            }
        } else {
            if (failure) {
                failure(money.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
    
}

+ (void)settingWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(bpXPwZJLCFMineSettingDataModelhmSxqV *))success failure:(void (^)(NSString *))failure
{

    [[JLCFHttpManager sharedManager] postDataWithUrl:SETTING_URL params:params loadingInView:view success:^(NSDictionary *result) {

        cygGGEJLCFMineSettingResultModelqnTwtB *setting = [[cygGGEJLCFMineSettingResultModelqnTwtB alloc] initWithDictionary:result error:nil];

        if ([setting.code isEqualToString:@"200"]) {
            if (success) {
                success(setting.data);
            }
        } else {
            if (failure) {
                failure(setting.msg);
            }
        }

    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
}

+ (void)changePassWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:CHANGEPASS_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)bankCardWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(ELbxxpJLCFMineBankCardResultModelLJOnsl *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:BANKCARD_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        ELbxxpJLCFMineBankCardResultModelLJOnsl *card = [[ELbxxpJLCFMineBankCardResultModelLJOnsl alloc] initWithDictionary:result error:nil];
        
        if (success) {
            success(card);
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
    
}

+ (void)flFGIcbindCardmirovYSendMsgWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:BINDCARDMSG_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)unBindCardSendMsgWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:UNBINDCARDMSG_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)flFGIcbindCardmirovYWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:BINDCARD_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)mineAddressListWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(WNbFQgJLCFMineAddressResultModelcDVvLd *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MINE_ADDRESS_LIST_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        WNbFQgJLCFMineAddressResultModelcDVvLd *dic = [[WNbFQgJLCFMineAddressResultModelcDVvLd alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success(dic);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)saveAndUpdateAddressWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:SAVEANDUPDATE_ADDRESS_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)deleteAddressWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:DELETEADDRESS_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)welfareWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(YvmmJAJLCFXNbZWBMineWelfareResultModeleKVPRGMnuDpo *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:WELFARE_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        YvmmJAJLCFXNbZWBMineWelfareResultModeleKVPRGMnuDpo *dic = [[YvmmJAJLCFXNbZWBMineWelfareResultModeleKVPRGMnuDpo alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success(dic);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)topUpWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(YgMWMCJLCFFuyouInfoModelNQcnsr *data))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:TOPUP_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                
                success([[YgMWMCJLCFFuyouInfoModelNQcnsr alloc]initWithDictionary:dic.data error:nil]);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
}

+ (void)withdrawWith:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:WITHDRAW_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)codeBankWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(void))success failure:(void (^)(NSString *))failure
{
    [[JLCFHttpManager sharedManager] postDataWithUrl:CODEBANK_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success();
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}


+ (void)isBanckCardSuportWithparams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(FSgGvPJLCFCardInfoModelLPToqL *data))success failure:(void (^)(NSString *))failure{
    [[JLCFHttpManager sharedManager] postDataWithUrl:BANK_SURPORT params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                FSgGvPJLCFCardInfoModelLPToqL *data = [[FSgGvPJLCFCardInfoModelLPToqL alloc]initWithDictionary:dic.data error:nil];
                success(data);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
}

+ (void)hasBanckCardWithparams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(NSDictionary *data))success failure:(void (^)(NSString *))failure{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:HAS_CART params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                success(dic.data);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
}


+ (void)myCardWithparams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(SssHPaJLCFMYCardInfoModelHkAXvP *data))success failure:(void (^)(NSString *))failure{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MY_CARD params:params loadingInView:view success:^(NSDictionary *result) {
        
        JLCFBaseDicModel *dic = [[JLCFBaseDicModel alloc] initWithDictionary:result error:nil];
        
        if ([dic.code isEqualToString:@"200"]) {
            if (success) {
                
                success([[SssHPaJLCFMYCardInfoModelHkAXvP alloc] initWithDictionary:dic.data error:nil]);
            }
        } else {
            if (failure) {
                failure(dic.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
}


@end
